<%@ page contentType="text/html;charset=utf-8"%>
<%@ page
	import="java.io.*, java.sql.*, java.util.*, java.text.*, napal.*, util.*, napal.*"%>
<%@ page import="org.apache.ibatis.*"%>
<%@ page import="java.util.Date"%>
<%
	request.setCharacterEncoding("utf-8");
%>

<%@ include file="./Header.jsp"%>
			</td>
		</TR>
		<TR HEIGHT="100">
			<TD>
			<a href="InfoChange.jsp" class="btn btn-link btn-small">정보변경<br></a>
<br><br>
				<%
					if ("수정".equals(request.getParameter("cmd"))) {
						String n = request.getParameter("id2");
						String n3 = request.getParameter("CPw");
						String n2 = request.getParameter("CPhone");
						RentalHome.updateUser(n, n2, n3);
				%>
				<script language=javascript>
				self.window.alert("입력한 정보를 수정하였습니다.");
				location.href="Main.jsp";
			</script> <%
 	}
 %> <%
 	String s1 = request.getParameter("id");
 	if (s1 == null) {
 		s1 = "";
 	} else {

 		User user1 = RentalHome.getUser(s1);

 		if (user != null) {
 %>
				<form name="ChangeInfo"
					action="InfoChange.jsp?id=<%=user1.get사용자ID()%>" method="POST">
					<TABLE WIDTH="100%" class="table table-bordered">
						<TR>
						</TR>
						<TR>
							<td>사용자ID</td>
							<TD><%=user1.get사용자ID()%></td>
						</tr>
						<Tr>
							<td>비밀번호</td>
							<td><input name="CPw" type="text" value=<%=user1.get비밀번호()%>></td>
						</tr>
						<tr>
							<td>이름</td>
							<td><%=user1.get이름()%></td>
						</tr>
						<tr>
							<td>학과이름</td>
							<Td><%=user1.get학과이름()%></td>
						</tr>
						<%
							if (user1.get학년() != 0) {
						%>
						<Tr>
							<td>학년</td>
							<td><%=user1.get학년()%></td>
						</tr>
						<tr>
							<td>학번</td>
							<td><%=user1.get학번()%></td>
						</tr>
						<%
							}
						%>
						<tr>
							<td>연락처</td>
							<td><input name="CPhone" type="text"
								value=<%=user1.get연락처()%>></td>
						</tr>
						<tr>
							<td>사용자직급</td>
							<td><%=user1.get사용자직급()%></td>
						</Tr>
					</TABLE>
<p align="center">
					<input type=hidden name="id2" value="<%=user1.get사용자ID()%>">
					<input name="cmd" class="btn btn-inverse" type=submit value="수정" > <a
						href="Header.jsp?id=<%=user1.get사용자ID()%>" class="btn btn-inverse">취소</a></p>
				</form> <%
		}
	%> <%
			}
		%>
			</td>
		</tr>
		<TR HEIGHT="50">
			<TD><%@ include file="./bottom.jsp"%></TD>
		</TR>
	</TABLE>
</body>
</html>